package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 * 记事本工具
 */
public class TestNote {
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        FileOutputStream fos =new FileOutputStream("note.txt");
        System.out.println("_(:з」∠)_输入exit退出");
        while (true){
            String note = scan.nextLine();
            if(note.equals("exit")){//必须equals ==比较地址，equals比较内容
                break;
            }
            fos.write(note.getBytes(StandardCharsets.UTF_8));
        }
        fos.close();
        System.out.println("\\(^o^)/~ok");
    }
}
